package cn.cdeden.sys.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ProjectName : ecm_svn
 * @Package : com.cdyd.ecm.core.sys.domain.config
 * @ClassName : LoginMethod
 * @Author : Yu.
 * @Description : // TODO
 * @Date : 2024/3/12 17:38
 * @Version : 1.0
 */

@AllArgsConstructor
@Getter
public enum LoginMethod {
    USERNAME("username","账号","account","账号"),
    EMAIL("email","邮箱","account","账号"),
    PHONE("phone","电话","account","账号"),
    JOB_NUMBER("jobNumber","工号","account","账号"),
    SSO("SSO","单点登录","sso","单点"),
    WXSCAN("wxscan","企业微信","authorization","授权"),
    AD("ad","Ad域登录","account","授权"),
    OAuth("OAuth","OA登录","account","授权"),



    ;

    private String code;
    private String value;
    private String codeType;
    private String type;


    // 添加一个从字符串获取枚举的方法（可根据实际需求决定是否需要）
    public static LoginMethod fromCode(String code) {
        for (LoginMethod method : values()) {
            if (method.getCode().equals(code)) {
                return method;
            }
        }
        return null;
    }
}
